package cn.lsj.readwriteseparation.mapper;

import cn.lsj.readwriteseparation.entity.Address;
import cn.lsj.readwriteseparation.entity.User;
import cn.lsj.readwriteseparation.model.bo.UserAddressBO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @className:
 * @description: TODO 类描述
 * @author: liangshijie
 * @date: 2022/12/5
 **/
public interface AddressMapper extends BaseMapper<Address> {

    @Select("select * FROM `user` a left join address b on a.id = b.user_id WHERE a.id = #{userId}")
    List<UserAddressBO> getUserAddress(@Param("userId") Long userId);

}
